package com.baidu.bulls.stock.admin.user.service;

import com.baidu.bulls.stock.common.exception.BusinessException;
import com.baidu.bulls.stock.entity.user.AuthorityUser;
import com.baidu.bulls.stock.entity.user.AuthorityUserRole;
import org.springframework.transaction.annotation.Transactional;

public interface AuthorityLogicService {
    /**
     * 保存角色权限接口
     *roleAuth:
     * roleIds:
     * @throws Exception
     */
    @Transactional(rollbackFor = Exception.class)
    void savePrivileges(String roleAuth, String... roleIds) throws Exception;

    /**
     * 分配用户与角色的关联关系接口
     *
     * @param authorityUserRole
     * @param authorityUser
     * @throws BusinessException
     */
    @Transactional
    void userAddRoles(AuthorityUserRole authorityUserRole, AuthorityUser authorityUser) throws BusinessException;
}
